/*
 * TestAI.h
 *
 *  Created on: Nov 4, 2008
 *      Author: Ryan
 */

#ifndef TAI_H_
#define TAI_H_

#include "../../OOInterface/Interfaces/AIHandle.h"
#include "../../OOInterface/Interfaces/GameListener.h"
#include "../../OOInterface/AIInterface.h"

#include "ResourceAnalysisUnit.h"

#include <boost/thread/mutex.hpp>

class TAI: public OOInterface::AIHandle, public OOInterface::GameListener
{
public:
	TAI( OOInterface::AIInterface* i );
	virtual ~TAI();

	virtual void init( OOInterface::ConstPlayerPtr self );
	virtual void update();
	virtual void run();


	virtual void handle( OOInterface::ConstGameEventPtr e );

private:
	int _frame;
	OOInterface::ConstPlayerPtr _self;
	ResourceNodes _nodes;

	boost::mutex _nodeMutex;

	bool buildHere( OOInterface::ConstUnitPtr unit, OOInterface::Point3f& p );
};

#endif /* TAI_H_ */
